﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThridGroup.ERP.DTO;
using Volo.Abp.Application.Services;

namespace ThridGroup.ERP.RBAC
{
    /// <summary>
    /// 权限接口  ---tsh
    /// </summary>
    public interface IPermissionServices:IApplicationService
    {
        /// <summary>
        /// 添加权限    ---tsh
        /// </summary>
        /// <param name="permission">实体</param>
        /// <returns>受影响行数</returns>
        Task<int> AddPermission(Permission permission);
        /// <summary>
        /// 删除权限    ---tsh
        /// </summary>
        /// <param name="permission">实体</param>
        /// <returns>受影响行数</returns>
        Task<int> DelPermission(Permission permission);
        /// <summary>
        /// 修改权限    ---tsh
        /// </summary>
        /// <param name="permission">实体</param>
        /// <returns>受影响行数</returns>
        Task<int> UpdPermission(Permission permission);
        /// <summary>
        /// 查询权限    ---tsh
        /// </summary>
        /// <returns>集合</returns>
        IQueryable<Permission> QueryPermission();

        /// <summary>
        /// 获取权限树形数据
        /// </summary>
        /// <returns>权限树形结构</returns>
        Task<List<PermissionTreeDto>> GetPermissionTree();

        /// <summary>
        /// 根据ID获取单个权限
        /// </summary>
        /// <param name="id">权限ID</param>
        /// <returns>权限信息</returns>
        Task<Permission> GetPermissionById(int id);

        /// <summary>
        /// 根据ID获取权限详细信息（用于表单回填）
        /// </summary>
        /// <param name="id">权限ID</param>
        /// <returns>权限详细信息</returns>
        Task<PermissionDetailDto> GetPermissionDetailById(int id);

        /// <summary>
        /// 获取所有权限列表
        /// </summary>
        /// <returns>权限列表</returns>
        Task<List<Permission>> GetAllPermissions();
    }
}
